import { PageConfig } from 'next';
import anylogger from 'anylogger';
import '@mmstudio/an000042';
import an48 from '@mmstudio/an000048';
import { tbactivityfollow } from '../../../atoms/db';

const logger = anylogger('pages/api/activity/addfollow.api');

export type Result = {
	ok: boolean;
	message: string;
};


export type Message = {
	/**
	 * 活动id
	 */
	aid: string;
	/**
	 * 活动主题
	 */
	theme: string;
};

/**
 * 关注活动-新增
 */
const handler = an48<Result>();

handler.post(async (req, res) => {
	try {
		logger.debug('msg body:', req.body);
		// const { } = req.body as Message;

		res.status(200).json({ ok: true, message: '' });
	} catch (error) {
		logger.error(error);
		logger.trace(error);
		res.status(200).json({ ok: false, message: (error as Error).message });
	}
});

export const config = {} as PageConfig;

export default handler;
